﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hotnet.Entity;
using Hotnet.Dal.BaseRepository;
using Hotnet.Entity.Enum;
using Hotnet.Entity.Search;

namespace Hotnet.Dal.NSDalVideo
{
	public class DalVideoChild : Repository<VideoChild>
	{
		public VideoChild[] ListVideoChilds(int pageNo, int pageSize, out int totalCount, int groupID)
		{
			int from = pageNo * pageSize ;
			var videoChilds=(from videoChild in diableCacheGiveTable where videoChild.GroupID==groupID select videoChild).OrderBy<VideoChild,int>(x=>x.OrderInGroup.Value).Skip(from).Take(pageSize);
			totalCount = (from videoChild in diableCacheGiveTable where videoChild.GroupID == groupID select videoChild.VideoID).Count();
			return videoChilds.ToArray();
		}
	}
}
